import News from "../pages/News/News";
import Message from "../pages/Message/Message";
import NotFound from "../pages/NotFound/NotFound";
import Home from "../pages/Home/Home";
import About from "../pages/About/About";
import {Navigate} from 'react-router-dom';

export default [
  //一个对象对应一个路由规则
  {
    path: '/home',
    element: <Home />,
    //小孩子们
    children: [
      {
        path: 'news',
        element: <News  />
      },
      {
        path: 'message',
        element: <Message  />
      },
      {
        index: true,
        element: <Navigate to="/home/news"  />
      }
    ]
  },
  {
    path: '/about',
    caseSensitive: true, //是否区分大小写, 默认 false 不区分
    element: <About />
  },
  {
    path: '*',
    element: <NotFound  />
  }
]